<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/commons/include/html_doctype.html" %>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<%@include file="/commons/page/codegen.jsp" %>
		<script type="text/javascript" src="${ctx}/js/gpoint/rdp/TimeSegment/timeSeg.js"></script>
		<style>
		    fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}
			legend{padding:.5em;border:0;width:auto}
		</style>
	</head>
	
	<body>
		<!-- 顶部按钮 -->
		<div class="wrapper wrapper-content  animated fadeInRight col-sm-12">
			<!-- <div class="panel-toolbar ">
				<div class="buttons">
					<a href="javascript:void(0);" class="btn btn-primary fa fa-save" ><span>保存</span></a>
					<a href="list.htm" class="btn btn-primary fa fa-back" ><span>返回</span></a>
				</div>
			</div> -->
			<div class="">
				<form  class="fr-form"  id="timeSegForm" action="save.htm" >
					<input type="hidden" name="m:timeSeg:id"  value="${timeSeg.id}"/>
					
					<div class="fr_response_field col-sm-12" >
							<div class="fr_response_field col-sm-6" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">时段号[2-255]</label>
								  	<div class="fr-form-block" data-type="fixed">
								           <input id ="timeseg"  type="number" min="2" max="255"  onchange="checkMaxMin('#timeseg');" style="width:200px;" class="fr-form-control" name="m:timeSeg:timeseg" value="${timeSeg.timeseg==null?2:timeSeg.timeseg}" validate="{required:true}"/>			
								 	</div>
							  	</div>
							</div>	
							<div class="fr_response_field col-sm-6" >
							 	<div class="fr-form-group"> 
								 	<label class="fr-control-label">时段名称</label>
								  	<div class="fr-form-block" data-type="fixed">
								           <input type="text"  readonly="readonly" style="width:200px;" class="fr-form-control" name="m:timeSeg:timesegms" value="${timeSeg.timesegms}" validate="{required:true}"/>				
								 	</div>
							  	</div>
							</div>	
							
							
							<div class="fr_response_field col-sm-6" >
							
							   	<fieldset style="height:97px;">	

								    <div class="fr_response_field col-sm-12"  style="margin-top:25px;">
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label" style="width:170px;">下一个链接时段[0-255]</label>
										  	<div class="fr-form-block" data-type="fixed" >
										         <input id ="nextLinkPeriod" type="number" readonly="readonly" min="0" max="255"  style="width:130px;" onchange="checkMaxMin('#nextLinkPeriod');" class="fr-form-control" name="m:timeSeg:nextLinkPeriod" value="${timeSeg.nextLinkPeriod==null?0:timeSeg.nextLinkPeriod}" validate="{required:false}"/>				
										 	</div>
									  	</div>
									</div>										
								</fieldset>
			               					               					
					        </div>
					        
					        <div class="fr_response_field col-sm-6" >
					             <fieldset  style="height:97px;">									
									    <div class="fr_response_field col-sm-12" >
										 	<div class="fr-form-group"> 
											 	<label class="fr-control-label">开始时间</label>
											  	<div class="fr-form-block" data-type="fixed">
													<div class="input-icon" >
														<i class="fa fa-calendar"></i>
														<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="yyyy-MM-dd"   name="m:timeSeg:startdate"   value="${timeSeg.startdate}" validate="{required:true}"/>
													</div>				
											 	</div>
										  	</div>
										</div>
										<div class="fr_response_field col-sm-12" >
										 	<div class="fr-form-group"> 
											 	<label class="fr-control-label">结束时间</label>
											  	<div class="fr-form-block" data-type="fixed">
													<div class="input-icon" >
														<i class="fa fa-calendar"></i>
														<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="yyyy-MM-dd"   name="m:timeSeg:enddata"   value="${timeSeg.enddata}" validate="{required:true}"/>
													</div>		
											 	</div>
										  	</div>
										</div>									
								</fieldset>
					        </div>
					        
					        
					        
					        <div class="fr_response_field col-sm-6" >
								<fieldset style="height:355px;">
								    <legend>有效星期选项</legend>
									<div class="fr_response_field col-sm-12" >
									      <input type="hidden" class="checkbox" name="m:timeSeg:week1"  value="${timeSeg.week1}"/>
										  <input type="checkbox" style = "display:inline-block;" class="checkbox"  ${timeSeg.week1 eq 1?'checked=true':''} value="${timeSeg.week1}" validate="{required:false}"/> 星期一	
									</div>
									<p style="height:33px;"></p>	
									<div class="fr_response_field col-sm-12" >
									      <input type="hidden" class="checkbox" name="m:timeSeg:week2"  value="${timeSeg.week2}"/>
										  <input type="checkbox" style = "display:inline-block;" class="checkbox"  ${timeSeg.week2 eq 1?'checked=true':''} value="${timeSeg.week2}" validate="{required:false}"/> 星期二 	
									</div>
									<p style="height:33px;"></p>	
									<div class="fr_response_field col-sm-12" >
									      <input type="hidden" class="checkbox" name="m:timeSeg:week3"  value="${timeSeg.week3}"/>
										  <input type="checkbox" style = "display:inline-block;" class="checkbox"  ${timeSeg.week3 eq 1?'checked=true':''} value="${timeSeg.week3}" validate="{required:false}"/> 星期三 	
									</div>
									<p style="height:33px;"></p>	
									<div class="fr_response_field col-sm-12" >
									       <input type="hidden" class="checkbox" name="m:timeSeg:week4"  value="${timeSeg.week4}"/>
										   <input type="checkbox" style = "display:inline-block;" class="checkbox"  ${timeSeg.week4 eq 1?'checked=true':''} value="${timeSeg.week4}" validate="{required:false}"/> 星期四		
									</div>
									<p style="height:33px;"></p>										
									<div class="fr_response_field col-sm-12" >
									      <input type="hidden" class="checkbox" name="m:timeSeg:week5"  value="${timeSeg.week5}"/>
										  <input type="checkbox" style = "display:inline-block;" class="checkbox"  ${timeSeg.week5 eq 1?'checked=true':''} value="${timeSeg.week5}" validate="{required:false}"/> 星期五  	
									</div>
									<p style="height:33px;"></p>										
									<div class="fr_response_field col-sm-12" >	
									      <input type="hidden" class="checkbox" name="m:timeSeg:week6"  value="${timeSeg.week6}"/>									 										    
										  <input type="checkbox" style = "display:inline-block;" class="checkbox"  ${timeSeg.week6 eq 1?'checked=true':''} value="${timeSeg.week6}" validate="{required:false}"/> 星期六		
									</div>
									<p style="height:33px;"></p>										
									<div class="fr_response_field col-sm-12" >
									      <input type="hidden" class="checkbox" name="m:timeSeg:week7"  value="${timeSeg.week7}"/>
										  <input type="checkbox" style = "display:inline-block;" class="checkbox" ${timeSeg.week7 eq 1?'checked=true':''} value="${timeSeg.week7}" validate="{required:false}"/> 星期日	
									</div>
								
								</fieldset>
					        </div>
					        
					        
					        
					        <div class="fr_response_field col-sm-6" >
					            <fieldset style="height:355px;">
								    <legend>每日有效时区</legend>
								    <div class="fr_response_field col-sm-12" >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">时区1开始时间</label>
										  	<div class="fr-form-block" data-type="fixed">
												<div class="input-icon" >
													<i class="fa fa-calendar"></i>
													<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="HH:mm"   name="m:timeSeg:timezone1Starttime"   value="${timeSeg.timezone1Starttime== null? '00:00':timeSeg.timezone1Starttime}" validate="{required:true}"/>
												</div>				  					
										 	</div>
									  	</div>
									</div>
									 	<div class="fr_response_field col-sm-12" >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">时区1结束时间</label>
										  	<div class="fr-form-block" data-type="fixed">
										<div class="input-icon" >
											<i class="fa fa-calendar"></i>
											<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="HH:mm"   name="m:timeSeg:timezone1Endtime"   value="${timeSeg.timezone1Endtime== null? '00:00':timeSeg.timezone1Endtime}" validate="{required:true}"/>
										</div>
										  					
										 	</div>
									  	</div>
									</div>
									 	<div class="fr_response_field col-sm-12" >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">时区2开始时间</label>
										  	<div class="fr-form-block" data-type="fixed">
												<div class="input-icon" >
													<i class="fa fa-calendar"></i>
													<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="HH:mm"   name="m:timeSeg:timezone2Starttime"   value="${timeSeg.timezone2Starttime== null? '00:00':timeSeg.timezone2Starttime}" validate="{required:true}"/>
												</div>
										  					
										 	</div>
									  	</div>
									</div>
									 	<div class="fr_response_field col-sm-12" >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">时区2结束时间</label>
										  	<div class="fr-form-block" data-type="fixed">
												<div class="input-icon" >
													<i class="fa fa-calendar"></i>
													<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="HH:mm"   name="m:timeSeg:timezone2Endtime"   value="${timeSeg.timezone2Endtime== null? '00:00':timeSeg.timezone2Endtime}" validate="{required:true}"/>
												</div>				  					
										 	</div>
									  	</div>
									</div>
									 	<div class="fr_response_field col-sm-12" >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">时区3开始时间</label>
										  	<div class="fr-form-block" data-type="fixed">
												<div class="input-icon" >
													<i class="fa fa-calendar"></i>
													<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="HH:mm"   name="m:timeSeg:timezone3Starttime"   value="${timeSeg.timezone3Starttime== null? '00:00':timeSeg.timezone3Starttime}" validate="{required:true}"/>
												</div>				  					
										 	</div>
									  	</div>
									</div>
									 <div class="fr_response_field col-sm-12" >
									 	<div class="fr-form-group"> 
										 	<label class="fr-control-label">时区3结束时间</label>
										  	<div class="fr-form-block" data-type="fixed">
												<div class="input-icon" >
													<i class="fa fa-calendar"></i>
													<input type="text" readonly="readonly" class="fr-form-control datepicker" datefmt="HH:mm"   name="m:timeSeg:timezone3Endtime"   value="${timeSeg.timezone3Endtime == null? '00:00':timeSeg.timezone3Endtime}" validate="{required:true}"/>
												</div>				  					
										 	</div>
									  	</div>
									</div>	
								
								</fieldset>				       					       
					       </div>			
					</div>
					
					
					
					
					
					<script type="text/javascript">
				    var id='${timeSeg.id}';
					$(function(){						
						$(".checkbox").change(function(){
							if($(this).prop("checked")){
								$(this).prev().val("1")
							}else{
								$(this).prev().val("0")
							}
						});
						
						if(id==''){
							$(".checkbox").prop("checked",true);
							$(".checkbox").val("1");
						}
						
					});
					function checkMaxMin(id){
						var min = $(id).attr("min");
						var max = $(id).attr("max");
						var value = $(id).val();
						if(value<min){
							 $(id).val(min);
						}
						if(value>max){
							$(id).val(max);
						}						
					}

					
					</script>
					
					
					
					
					
					
					





			

			
			

               </form>

			</div>
		</div>
	</body>
</html>